package initialize

import (
	"fmt"
	"go-fiber-ip2region/global"
	"go-fiber-ip2region/storage"
)

func Timer() {
	_, err := global.GLOBAL_TIMER.AddTaskByFunc("emptyLocalIpList", "0 8 * * *", func() {
		storage.EmptyIpGroup()
		fmt.Println("cron: ip group cache emptied")
	})
	if err != nil {
		fmt.Printf("cron err: %v\n", err)
	}
}
